package com.by.hellospringboot.controller.request;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Range;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;


@Getter
@Setter
public class UserRequestBean {

    @NotNull(message = "用户名不能为空")
    private String username;

    @NotNull(message = "年龄不能为空")
    @Range(min = 18, max = 24, message = "年龄要在18-24之间")
    private Integer age;

    @NotNull(message = "性别不能为空")
    @Range(min = 0, max = 1, message = "性别只能是男1女0")
    private Integer gender;

    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\\d{8}", message = "请输入合法的手机号")
    private String phone;

    private String accessCardNumber;


}
